﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DPW.Business.Repository;
using DPW.Entity;

namespace DPW.Business.Model
{
    public class CategoryModel
    {
        private Category category;

        public CategoryModel()
        {
           this.category = new Category();
        }

        public CategoryModel(Category category)
        {
            this.category = category;
        }


        public int Id
        {
            get { return category.CategoryId; }
        }
        public string Name
        {
            get { return category.CategoryName; }
        }
        public string Description
        {
            get { return category.CategoryDescription; }
        }

        public IEnumerable<PoemModel> Poems
        {
            get
            {
                var allPoemEntities = CategoryRepository.GetPoemsOfCategory(Id);
                if(allPoemEntities != null)
                {
                    return allPoemEntities;
                }
                else
                {
                    return null;
                }
            }
        }


    }
}
